package com.bw.zg3park2212.payler

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ToastUtils
import com.bw.base.entity.PaylerAddParam
import com.bw.base.mvvm.BaseActivity
import com.bw.zg3park2212.R
import com.bw.zg3park2212.databinding.ActivityPaylerAddBinding
import dagger.hilt.android.AndroidEntryPoint

@AndroidEntryPoint
@Route(path = "/app/PaylerAddActivity")
class PaylerAddActivity : BaseActivity<ActivityPaylerAddBinding,PaylerViewModel>() {
    override fun intitView() {
        binding.keep.setOnClickListener {
            var paylerAddParam=PaylerAddParam()
            paylerAddParam.actualAmount= binding.chargeMoney.text.toString().toInt()
            paylerAddParam.chargeAmount= binding.chargeMoney.text.toString().toInt()
            paylerAddParam.receivableAmount= binding.chargeMoney.text.toString().toInt()
            paylerAddParam.chargeType= binding.chargeProject.text.toString()
            paylerAddParam.payerName= binding.chargeUname.text.toString()
            paylerAddParam.contactNumber= binding.chargePhone.text.toString().toLong()
            viewmodel.getpayleradd(paylerAddParam)
        }
    }

    override fun intitData() {
        viewmodel.payleraddSuccse.observe(this){
            ToastUtils.showLong("添加成功")
            finish()
        }
    }

}